package com.xiaotu.spring.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author zhangxiao
 * @create 2021-11-05 17:13
 */
@Service
public class BeanA {

    @Autowired
    private BeanB beanB;

    public BeanA() {
        System.out.println("这是Bean A 的构造方法");
    }

    @PostConstruct
    private void init() {
        System.out.println("这是BeanA的 init 方法");
        beanB.testB();
    }

}
